package com.adjaisd.scarecrow.testJava;

import com.adjaisd.scarecrow.entity.Device;
import com.adjaisd.scarecrow.entity.DeviceGps;
import com.adjaisd.scarecrow.service.DeviceGpsService;
import com.adjaisd.scarecrow.service.DeviceService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

@SpringBootTest
public class testDeviceGps {

    @Autowired
    DeviceService deviceService;

    @Autowired
    DeviceGpsService deviceGpsService;

    @Test
    void getDeviceGpsByNumber() {
        List<Device> allDevice = deviceService.getAllDevice();
        for (Device device : allDevice) {
            DeviceGps gps = deviceGpsService.getDeviceGps(device.getNumber());
            System.out.println(gps);
        }
    }
}
